package com.situ.ssm.singleton;
//懒汉式单例模式
public class Singleton {
	private static Singleton instance = null;
	
	//私有化
	public Singleton() {
	}
	
	//线程加锁
	public static Singleton getInstance() {
		if (instance == null) {
			instance = new Singleton();
		}
		return instance;
	}
}
